package top.ezzz.common;

import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;

import java.util.Date;

public class TimestampUtil {

    public static int getSeconds() {
        return (int) (DateUtil.date().getTime() / 1000);
    }

    public static int getSeconds(Date date) {
        return (int) (DateUtil.date(date).getTime() / 1000);
    }

    public static DateTime getTime(int seconds) {
        return new DateTime(seconds * 1000L);
    }

}
